package com.woniu.smart.service.impl;

import com.github.pagehelper.PageHelper;
import com.woniu.smart.dto.PublicResourceDTO;
import com.woniu.smart.entity.Publicresource;
import com.woniu.smart.mapper.PublicresourceMapper;
import com.woniu.smart.service.PublicresourceService;
import com.woniu.smart.vo.PublicresourceVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 晨星
 * @date 2022/10/21/22:04
 */
@Service
public class PublicresourceServiceImpl implements PublicresourceService {

    @Autowired
    private PublicresourceMapper publicresourceMapper;

    @Override
    public List<PublicresourceVo> selectAll(PublicResourceDTO publicResourceDTO) {
        PageHelper.startPage(publicResourceDTO.getCurrentPage(),publicResourceDTO.getPageSize());
        return publicresourceMapper.selectAll(publicResourceDTO);
    }

    @Override
    public int deleteByPrimaryKey(Long id) {
        return publicresourceMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insertSelective(Publicresource record) {
        return publicresourceMapper.insertSelective(record);
    }

    @Override
    public Publicresource selectByPrimaryKey(Long id) {
        return publicresourceMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Publicresource record) {
        return publicresourceMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int deleteBatch(List<Integer> publicresourceIds) {
        return publicresourceMapper.deleteBatch(publicresourceIds);
    }
}
